package com.swe.chums.dao.model;

import com.swe.chums.dao.*;
import com.swe.chums.dao.factory.*;
import com.swe.chums.dao.exceptions.*;
import java.io.Serializable;
import java.util.*;

public class WebResource implements Serializable
{
	/** 
	 * This attribute maps to the column id in the web_resource table.
	 */
	protected int id;
        
        protected int averageRatingInt;
        
        protected int ratingCount;
        
        protected boolean favorited = false;

	/** 
	 * This attribute maps to the column web_resource_type_id in the web_resource table.
	 */
	protected int webResourceTypeId;

	/** 
	 * This attribute maps to the column url_hash_id in the web_resource table.
	 */
	protected int urlHashId;

	/** 
	 * This attribute represents whether the primitive attribute urlHashId is null.
	 */
	protected boolean urlHashIdNull = true;

	/** 
	 * This attribute maps to the column url in the web_resource table.
	 */
	protected String url;

	/** 
	 * This attribute maps to the column title in the web_resource table.
	 */
	protected String title;

	/** 
	 * This attribute maps to the column description in the web_resource table.
	 */
	protected String description;

	/** 
	 * This attribute maps to the column thumbnail_file_name in the web_resource table.
	 */
	protected String thumbnailFileName;

	/** 
	 * This attribute maps to the column average_rating in the web_resource table.
	 */
	protected Double averageRating;
        
        protected Date insertDate;
        
        protected String tagsText;
        protected String instructorsText;
        protected String institutionText;
        protected ArrayList<Lessons> lessons;
        
        protected int hitCount;

	/**
	 * Method 'WebResource'
	 * 
	 */
	public WebResource()
	{
	}

    public boolean isFavorited() {
        return favorited;
    }

    public void setFavorited(boolean favorited) {
        this.favorited = favorited;
    }
        
        

    public int getRatingCount() {
        return ratingCount;
    }

    public void setRatingCount(int ratingCount) {
        this.ratingCount = ratingCount;
    }

        
        
    public int getHitCount() {
        return hitCount;
    }

    public void setHitCount(int hitCount) {
        this.hitCount = hitCount;
    }

    public int getAverageRatingInt() {
        return averageRatingInt;
    }

    public void setAverageRatingInt(int averageRatingInt) {
        this.averageRatingInt = averageRatingInt;
    }
    
    
    public ArrayList<Lessons> getLessons() {
        return lessons;
    }

    public void setLessons(ArrayList<Lessons> lessons) {
        this.lessons = lessons;
    }
        
        

	/**
	 * Method 'getId'
	 * 
	 * @return int
	 */
	public int getId()
	{
		return id;
	}

	/**
	 * Method 'setId'
	 * 
	 * @param id
	 */
	public void setId(int id)
	{
		this.id = id;
	}

    public String getInstructorsText() {
        return instructorsText;
    }

    public void setInstructorsText(String instructorsText) {
        this.instructorsText = instructorsText;
    }

    public String getInstitutionText() {
        return institutionText;
    }

    public void setInstitutionText(String institutionText) {
        this.institutionText = institutionText;
    }

    public String getTagsText() {
        return tagsText;
    }

    public void setTagsText(String tagsText) {
        this.tagsText = tagsText;
    }

	/**
	 * Method 'getWebResourceTypeId'
	 * 
	 * @return int
	 */
	public int getWebResourceTypeId()
	{
		return webResourceTypeId;
	}

	/**
	 * Method 'setWebResourceTypeId'
	 * 
	 * @param webResourceTypeId
	 */
	public void setWebResourceTypeId(int webResourceTypeId)
	{
		this.webResourceTypeId = webResourceTypeId;
	}

	/**
	 * Method 'getUrlHashId'
	 * 
	 * @return int
	 */
	public int getUrlHashId()
	{
		return urlHashId;
	}

    public Date getInsertDate() {
        return insertDate;
    }

    public void setInsertDate(Date insertDate) {
        this.insertDate = insertDate;
    }

	/**
	 * Method 'setUrlHashId'
	 * 
	 * @param urlHashId
	 */
	public void setUrlHashId(int urlHashId)
	{
		this.urlHashId = urlHashId;
		this.urlHashIdNull = false;
	}

	/**
	 * Method 'setUrlHashIdNull'
	 * 
	 * @param value
	 */
	public void setUrlHashIdNull(boolean value)
	{
		this.urlHashIdNull = value;
	}

	/**
	 * Method 'isUrlHashIdNull'
	 * 
	 * @return boolean
	 */
	public boolean isUrlHashIdNull()
	{
		return urlHashIdNull;
	}

	/**
	 * Method 'getUrl'
	 * 
	 * @return String
	 */
	public String getUrl()
	{
		return url;
	}

	/**
	 * Method 'setUrl'
	 * 
	 * @param url
	 */
	public void setUrl(String url)
	{
		this.url = url;
	}

	/**
	 * Method 'getTitle'
	 * 
	 * @return String
	 */
	public String getTitle()
	{
		return title;
	}

	/**
	 * Method 'setTitle'
	 * 
	 * @param title
	 */
	public void setTitle(String title)
	{
		this.title = title;
	}

	/**
	 * Method 'getDescription'
	 * 
	 * @return String
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * Method 'setDescription'
	 * 
	 * @param description
	 */
	public void setDescription(String description)
	{
		this.description = description;
	}

	/**
	 * Method 'getThumbnailFileName'
	 * 
	 * @return String
	 */
	public String getThumbnailFileName()
	{
		return thumbnailFileName;
	}

	/**
	 * Method 'setThumbnailFileName'
	 * 
	 * @param thumbnailFileName
	 */
	public void setThumbnailFileName(String thumbnailFileName)
	{
		this.thumbnailFileName = thumbnailFileName;
	}

	/**
	 * Method 'getAverageRating'
	 * 
	 * @return String
	 */
	public Double getAverageRating()
	{
		return averageRating;
	}

	/**
	 * Method 'setAverageRating'
	 * 
	 * @param averageRating
	 */
	public void setAverageRating(Double averageRating)
	{
		this.averageRating = averageRating;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof WebResource)) {
			return false;
		}
		
		final WebResource _cast = (WebResource) _other;
		if (id != _cast.id) {
			return false;
		}
		
		if (webResourceTypeId != _cast.webResourceTypeId) {
			return false;
		}
		
		if (urlHashId != _cast.urlHashId) {
			return false;
		}
		
		if (urlHashIdNull != _cast.urlHashIdNull) {
			return false;
		}
		
		if (url == null ? _cast.url != url : !url.equals( _cast.url )) {
			return false;
		}
		
		if (title == null ? _cast.title != title : !title.equals( _cast.title )) {
			return false;
		}
		
		if (description == null ? _cast.description != description : !description.equals( _cast.description )) {
			return false;
		}
		
		if (thumbnailFileName == null ? _cast.thumbnailFileName != thumbnailFileName : !thumbnailFileName.equals( _cast.thumbnailFileName )) {
			return false;
		}
		
		if (averageRating == null ? _cast.averageRating != averageRating : !averageRating.equals( _cast.averageRating )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + id;
		_hashCode = 29 * _hashCode + webResourceTypeId;
		_hashCode = 29 * _hashCode + urlHashId;
		_hashCode = 29 * _hashCode + (urlHashIdNull ? 1 : 0);
		if (url != null) {
			_hashCode = 29 * _hashCode + url.hashCode();
		}
		
		if (title != null) {
			_hashCode = 29 * _hashCode + title.hashCode();
		}
		
		if (description != null) {
			_hashCode = 29 * _hashCode + description.hashCode();
		}
		
		if (thumbnailFileName != null) {
			_hashCode = 29 * _hashCode + thumbnailFileName.hashCode();
		}
		
		if (averageRating != null) {
			_hashCode = 29 * _hashCode + averageRating.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return WebResourcePk
	 */
	public WebResourcePk createPk()
	{
		return new WebResourcePk(id);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.swe.chums.dao.dto.WebResource: " );
		ret.append( "id=" + id );
		ret.append( ", webResourceTypeId=" + webResourceTypeId );
		ret.append( ", urlHashId=" + urlHashId );
		ret.append( ", url=" + url );
		ret.append( ", title=" + title );
		ret.append( ", description=" + description );
		ret.append( ", thumbnailFileName=" + thumbnailFileName );
		ret.append( ", averageRating=" + averageRating );
		return ret.toString();
	}

}
